<template>
  <div id="prac">
    <h1>老爹</h1>
    控制子组件：<input type="number" v-model="faValue">
    <button @click="trans">转账</button>
    <h2>{{ sonValue }}</h2>
    <CallFather :msg="money" @eve="recive"></CallFather>
    <InputC :name="faValue"></InputC>
    <InputC name="写死"></InputC>
  </div>
</template>

<script>
import Prac1 from "@/components/input-component/Prac1.vue";
import CallFather from "@/components/input-component/callFather.vue";
import InputC from "@/components/input-component/InputB.vue";

export default {
  name:'prac10',
  components: {
    Prac1,
    CallFather,
    InputC
  },
  name: 'about',
  data() {
    return {
      faValue: 0,
      sonValue: '转账给儿子',
      money:0
    }
  },
  methods: {
    recive(sonValue) {
      this.sonValue = sonValue;
    },
    trans(){
      this.sonValue = '转账成功!';
      this.money=this.faValue;
    }
  }
}
</script>

<style>

</style>